{% load klass i18n extra model_list thumbnail %}

        {% for field in form %}
        
        <div class="control-group{% if field.errors %} error{% endif %}">
            <label class="control-label" for="{{ field.auto_id }}">
                {{ field.label_tag }}
            </label>
            <div class="controls">

                

                {% if field.field.widget|klass == "Select" %}
                    {{ field }}
                {% endif %}
                
                {% if field.field.widget|klass == "TextInput" %}
                <input type="text" class="input-large" name="{{ field.name }}" id="{{ field.auto_id }}" value="{% if field.value %}{{ field.value }}{% endif %}">
                {% endif %}
                {% endfor %}
                
                <div class="image_block">
                    {% model_list data IDataImageField object_list %}
                    
                    <div class="image_preview">
                        {% thumbnail object.value "128x128" crop="center" as im %}
                        <img src="{{ im.url }}" />
                        {% endthumbnail %}
                    </div>
                    
                    <div class="image_options">
                        {% trans "Текущее изображение:&nbsp;&nbsp;&nbsp;" %}
                        {% if object.value %}
                        <span class="label label-primary">{{ object.value }}</span>
                        {% else %}
                            <span class="label label-primary">{% trans "отсутствует" %}</span>
                        {% endif %}
                        <br /><br />
                        {% for field in form %}
                        {% if field.field.widget|klass == "ClearableFileInput" %}
                        <input type="file" />
                        {% endif %}
                        {% endfor %}
                    </div>
                     
                </div>
                
                        {% for field in form %}

                <!--{% comment %}
                {% if field.field.widget|klass == "Textarea" %}
                    <textarea class="span4" name="{{ field.name }}" id="{{ field.auto_id }}" rows="4">
                        {% if field.value %}{{ field.value }}{% endif %}
                    </textarea>
                {% endif %}
                {% endcomment %}-->
                
                {% if field.errors %}
                    <div><span for="name" generated="true" class="error" style="display: inline; ">
                        {% for error in field.errors %}{{ error }} {% endfor %}
                    </span></div>
                {% else %}
                    {% if field.help_text %}
                        <p class="help-block">
                            <strong>{% trans "Note" %}:</strong> 
                            {{ field.help_text }}
                        </p>
                    {% endif %}
                {% endif %}

            </div>
        </div>
        {% endfor %}

<!-- EOF -->
